﻿@using PlatformUW.Entities.Dtos

@if (Sensors.Count > 0)
{
    <table class="table">
        <thead>
            <tr>
                <th scope="col">ID</th>
                <th scope="col">名称</th>
                <th scope="col">描述</th>
                <th scope="col">站号</th>
                <th scope="col">操作</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var sensor in Sensors)
            {
                <tr>
                    <td class="align-middle">@sensor.Id</td>
                    <td class="align-middle">@sensor.Name</td>
                    <td class="align-middle">@sensor.Description</td>
                    <td class="align-middle">@sensor.Station</td>
                    <td class="align-middle">
                        <button type="button" class="btn btn-info">修改</button>
                        <button type="button" class="btn btn-danger">删除</button>
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <h4>加载中...</h4>
}

@code {
    [Parameter]
    public List<SensorDto> Sensors { get; set; }
}